package com.yeh.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yeh.dao.MenuDao;
import com.yeh.model.po.SysMenu;
import com.yeh.model.vo.Tree;
import com.yeh.service.MenuService;
/**
 * 
 * <p>Title: MenuServiceImpl</p>
 * <p>Description: 菜单操作</p>
 * <p>Company:  Co.</p>
 * <p>Package: com.yeh.service.impl</p>
 * @author <a href="mailto:yehshuai@126.com">叶帅</a>  
 * <p>DateTime: 2015年10月9日 ★  上午11:36:05</p> 
 * @Version V1.0.0
 */
@Service("menuService")
public class MenuServiceImpl extends BaseSerivceImpl<Tree, String> implements MenuService {


	@Autowired
	protected MenuDao menuDao;
	
	public List<Tree> getTree(){
		List<SysMenu> menuList = menuDao.getList();
		List<Tree> treeList = new ArrayList<Tree>();
		for(SysMenu m: menuList){
			Tree t = new Tree();
			BeanUtils.copyProperties(t,m);
		}
		return treeList;
	}

	@Override
	public void deleteObject(Tree model) {
		menuDao.delete(model);;
	}
	

}
